"""
系统相关API路由
"""
from flask import Blueprint, jsonify
from datetime import datetime

from config import Config

# 创建蓝图
system_bp = Blueprint('system', __name__, url_prefix='/api')


@system_bp.route('/health', methods=['GET'])
def health_check():
    """健康检查"""
    return jsonify({
        'status': 'healthy',
        'timestamp': datetime.now().isoformat(),
        'version': '1.0.0',
        'ai_configured': Config.is_ai_configured(),
        'ai_model': Config.AI_MODEL if Config.is_ai_configured() else None
    })


@system_bp.route('/ai-status', methods=['GET'])
def ai_status():
    """AI服务状态检查"""
    return jsonify(Config.get_ai_config())